package com.lu.common.test.barcode

import android.view.View
import androidx.appcompat.app.AppCompatActivity
import com.lu.barcode.BarcodeGenerator
import com.lu.barcode.BarcodeScanHelper
import com.lu.barcode.ScanListener

/**
 *author: luqihua
 *date:2023/11/20
 *description:
 **/
class BarcodeTestPage(private val context: AppCompatActivity) {
    private val scanHelper = BarcodeScanHelper(context, object : ScanListener {
        override fun onSuccess(content: String) {

        }

        override fun onFailure(message: String) {}
    })

    fun createBarcode(view: View?) {
        val sn = "asdkasd"
        val mac = "asdkasd"
        val model = "asdkasd"
        val version = "asdkasd"
        val opsType = ""
        val opsVer = ""
        val text =
            "http://wit.ruijie.com.cn/j/wechat/screen/scan?sn=$sn&mac=$mac&mode=$model&ver=${version}&opstype=${opsType}&opsver=${opsVer}"
        val bitmap = BarcodeGenerator.createQRBitmap(text, 100, 0)

    }

}